/**
 * Apr 3, 2010
 */
package org.tomale.id.gis;

import com.vividsolutions.jts.geom.Envelope;

/**
 * @author ferd
 *
 */
public abstract class MapElement {

	private int _id;
	private Layer _layer;
	
	private boolean _isDirty = false;
	private boolean _isSelected = false;
	
	public int getId(){
		return _id;
	}
	
	public void setId(final int id){
		_id = id;
	}
	
	public abstract Envelope getBounds();
	
//	public abstract ILayerProvider getLayer();
	
	public boolean isDirty(){
		return _isDirty;
	}
	
	public void setDirty(final boolean dirty){
		_isDirty = dirty;
	}
	
	public boolean isSelected(){
		return _isSelected;
	}
	
	public void setSelected(final boolean dirty){
		_isSelected = dirty;
	}
	
	public void setLayer(final Layer layer){
		_layer = layer;
	}
	
	public Layer getLayer(){
		if(_layer == null){
			throw new NullPointerException();
		}
		return _layer;
	}
}
